////
//
/// \file ./include/inc/parser/inc/parser/atomic_type_node.hpp
//
//  Copyright 2007, 2008 Chandler Carruth
//
//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
//  use this file except in compliance with the License.  You may obtain a copy
//  of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
//  License for the specific language governing permissions and limitations
//  under the License.
//
////

#ifndef inc_parser_atomic_type_node_header
#define inc_parser_atomic_type_node_header

#include <string>

#include <boost/scoped_ptr.hpp>

#include <inc/parser/parse_tree_node.hpp>

namespace inc {
namespace parser {

class IntTypeNode;
class FloatTypeNode;

/// \brief Atomic type parse node
/// \author Chandler Carruth
/// \date 2007.08.12
///
/// This parses an atomic primitive type node. Some of the primitive, first
/// class types in INC are atomic despite being parametric: they do not have
/// any recursion, and always stand on their own. This distinction is primarily
/// useful for vector types, but might be used elsewhere.

class AtomicTypeNode : public ParseTreeNode
{
public:
  AtomicTypeNode();
  virtual ~AtomicTypeNode();

  virtual bool parse( const iterator& first,
                      const iterator& last,
                      iterator& last_parsed );

  virtual IntTypeNode* get_int_type() const;
  virtual bool is_int_type() const { return get_int_type() != NULL; }
  virtual FloatTypeNode* get_float_type() const;
  virtual bool is_float_type() const { return get_float_type() != NULL; }

private:
  boost::scoped_ptr<ParseTreeNode> node;
};

} //  end parser namespace
} //  end inc namespace
#endif  //  inc_parser_atomic_type_node_header
